<template>
    <div class="cbox">
        {{ pmsg }}{{ pname }}
       <div class="btn" @click="sendCmsgToParent"></div>
    </div>
  </template>
  
  <script lang='ts' setup>

   defineProps<{pmsg:number,pname:string}>()
   //子传父
   const emit=defineEmits<{(e:'make',val:number):void}>()
   const sendCmsgToParent=()=>{
     emit('make',200)
     // this.$emit(自定义事件名,数据)
   }
  </script>
  
  <style lang='scss' scoped>
  .cbox{
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color:skyblue;
    .btn{
        width: 20px;
        height: 20px;
        background-color: red;

    }
  }

  </style>